<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>用户登录</title>
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;" />
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">  
    <script src="js/peizhi.js" type="text/javascript" charset="utf-8"></script>
  </head>
  <body>
    <style type="text/css">
      *{ margin: 0; padding: 0;}
      .all{ width: 100%; overflow: hidden;}
      .logo{ width: 60%; margin:15% auto; margin-top: 0; }
      .logo img{ width: 100%;}
      
      .login{position: absolute;left: 50%; margin-left: -35%; top: 10%; width: 70%; }
      
      .bj{ background: url(img/lgoinabj.png); width: 100%; border: 1px #FFFFFF solid; border-radius: 2px; padding-bottom: 15px;}
      .shuru{ padding-top: 10px;}
      .left{ float: left; color: #FFFFFF;}
      .left1{  padding-top: 6px; width: 30%; text-align: right; }
      .left2{ width: 70%; position: relative; float: left; }
      .yanzhengma{ font-size: 1rem !important; position: absolute; right: 20px; top: 0px; padding: 6px 8px; background:#FFFFFF; color: #666; border-radius: 2px; border: 1px #FFFFFF solid;}
      input{ background: none; border: none; color:#FFFFFF; padding: 6px 8px; width: 100%; }
      input:focus{ border: none; outline: none;}
      input::-webkit-input-placeholder{
                color: #fff;
            }
            .clear{ clear: both;}
             .xz{ padding: 8px 10px;  color: #FFFFFF; border: 1px #EAEAEA solid; border-radius: 5px; overflow: hidden; font-size: 1.2rem;}
      .xzhover{background: #FFFFFF; color: #000; }
      
            .denglu{  background: url(img/lgoinabj.png); border-radius: 2px; margin-top: 20px; text-align: center; 
            color: #FFFFFF; padding: 8px 0; border-radius: 3px; border: 1px #FFFFFF solid; text-decoration: none;"}
            
           
    </style>
    <div class="all">
      <img src="img/loginbj.jpg" style="width: 100%;"/>
      
      <div class="login">
        <div class="logo">
          <img src="img/loginlogo.png"/>
        </div>
        <div class="bj">
          <div class="shuru">
            <div class="left left1">手机号：</div>
            <div class="left left2"><input type="text" name="" id="shoujihao" value="" placeholder="请输入手机号" /></div>
            <div class="clear"></div>
          </div>
          <div class="shuru">
            <div class="left left1">密码：</div>
            <div class="left left2"><input type="password" name="" id="password" value="" placeholder="请输入密码" /></div>
            <div class="clear"></div>
          </div>
          <!--<div class="row text-center" style=" margin: 10px 0 0;">
            <span class="xz xzhover" data-id="0">求职登录</span>
            <span class="xz" data-id="1">猎头登录</span>
            <span class="xz" data-id="2">企业招聘</span>
          </div>-->
        </div>
        
        <div class="denglu" id="login">求职者登录</div>
        <!--<a href="denglu2.html" style="display: block; " class="denglu">快速登录</a>-->
<!--        <a href="denglult.html" style="display: block; " class="denglu">猎头登录</a>-->
        <a href="zhuce.html?type=0" style="display: block; float: left; width: 45%;" class="denglu">注册</a>
        <a href="zhaohui.html" style="display: block; float: right; width: 45%;" class="denglu">找回密码</a>
        <div class="clearfix"></div>
      </div>
    </div>
    <script type="text/javascript">
            //登录
            $("#login").click(function(){
              var shoujihao = $("#shoujihao").val();
              var dcode = $("#yanzhengma").val();
              var password = $("#password").val();
//            var RegisterType = $(".xzhover").data('id');
        var RegisterType = 0;
              var js = "{'tel':'"+shoujihao+"','password':'"+password+"','RegisterType':'"+RegisterType+"'}";
              $.ajax({
                    type: "POST",
                    url: jkurl,
                    beforeSend: function(request) {
                        request.setRequestHeader("req", "110");
                    },
                    dataType:"json",
                    data:js,
                    success: function(result) {
                        if(result.code == 1){
                          localStorage.setItem("tel", shoujihao);
                          localStorage.setItem("tokenid", result.resdata.TokenID);
                          localStorage.setItem("CompanyID", result.resdata.CompanyID);
                          localStorage.setItem("Level", result.resdata.Level);
                          localStorage.setItem("PortraitUrl", picurl+result.resdata.PortraitUrl);
                          localStorage.setItem("IsComplete", result.resdata.IsComplete);
                          localStorage.setItem("CompanyStatus", result.resdata.ConpanyStatus);
                          localStorage.setItem("RegisterType", RegisterType);
                        window.location.href='index.html';
                        }else{
                          alert(result.errormsg)
                        }
                    }
                });
            })
             $(".xz").click(function(){
              $(this).addClass("xzhover").siblings().removeClass("xzhover")
            })
      $(function(){
        var h = $(window).height();
        $(".all").height(h);
        
        //验证是否登录  若登录则返回到首页
        $.ajax({
              type: "POST",
              url: jkurl,
              beforeSend: function(request) {
                  request.setRequestHeader("req", "127");
                   request.setRequestHeader("TokenID", tokenid);
              },
              dataType:"json",
              success: function(result) {
                if(result.code == 1){
                    window.location.href='index.html';
                 }else{}
              }
          });
        
      })
    </script>
  </body>
</html>
